Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(autoware_perception_msgs): implement the proposed universal radar messages #120

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

knzo25
Copy link

@knzo25 knzo25 commented Mar 3, 2025

Description

This PR implemented the universal radar messages discussed in
https://github.com/orgs/autowarefoundation/discussions/5264

How was this PR tested?

Used together with tier4/nebula#284
to check the field contents

Notes for reviewers

None.

Effects on system behavior

None.

Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Copy link

github-actions bot commented Mar 3, 2025

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@knzo25 knzo25 requested review from YoshiRi, drwnz and technolojin March 3, 2025 05:18
@knzo25 knzo25 self-assigned this Mar 3, 2025
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
@knzo25
Copy link
Author

knzo25 commented Mar 3, 2025

Reference: https://github.com/autowarefoundation/autoware_msgs/blob/main/autoware_perception_msgs/msg/DetectedObject.msg

The one think I am over the fence on is about whether we should normalize the probabilities for [0.0, 1.0] or keep them [0.0, 100.0]. How do you guys think?

@technolojin technolojin requested a review from xmfcx March 4, 2025 01:08
@xmfcx
Copy link
Collaborator

xmfcx commented Mar 5, 2025

The one think I am over the fence on is about whether we should normalize the probabilities for [0.0, 1.0] or keep them [0.0, 100.0]. How do you guys think?

I am very surprised someone actually used 0->100 to represent probabilities. At least, any new implementation should have them normalized 0->1.

Copy link

@mojomex mojomex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably worth it to write have a small support library that

  1. ensures that RadarInfo is received before any RadarObjects are handled
  2. provides accessors for RadarObject fields that auto-convert/validate using the received RadarInfo

It seems quite easy to screw up as a user of these messages otherwise - e.g. orientation, is it deg, rad, something else?

uint8 MEASUREMENT_STATUS_PREDICTED = 1
uint8 MEASUREMENT_STATUS_NEW = 2
uint8 MEASUREMENT_STATUS_UNKNOWN = 3
uint8 MEASUREMENT_STATUS_INVALID = 255
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if these values are chosen for backward compatibility, but e.g. Protobuf recommends to make 0 the invalid option such that any zero-initialized message is invalid by default.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in d9728d4

Copy link

@drwnz drwnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!
This has changed a bit from the proposal, with the generalization of the field info being the biggest difference I can see. While this is clean, I wonder if it is good to explicitly define the info fields in the radar info message.

Another comment - whether to not this ends up being the catalyst to merge sensing and perception messages, these are quite complex message definitions so adding an explanation for the new types in the README would be very much appreciated (once the review of the contents themselves is complete).

While we don't use the radar detections currently, would it be worth defining it to make the info fields easier to understand/use in driver implementation?

@@ -0,0 +1,8 @@
std_msgs/String field_name
bool min_value_available
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the availability bools, I remember there was a discussion about using NaN (I guess the above suggestion by @xmfcx , using -1.0f may work for resolution, but it's a bit dangerous as requires the user to check an apparently irrelevant field for availability). I'm guessing having the bools as proposed is cleaner?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another way of doing this would be to use a field like
float32[<=1] min_value
which is functionally equivalent to an std::optional<float32>.
This would remove the need for the boolean field, and the user is forced to check if the value is present. Probably a bit ugly to use since it shows up as a dynamic bounded array, not an optional 🥲

knzo25 and others added 6 commits March 25, 2025 14:05
Co-authored-by: Taekjin LEE <technolojin@gmail.com>
Co-authored-by: Taekjin LEE <technolojin@gmail.com>
Co-authored-by: Mete Fatih Cırıt <xmfcx@users.noreply.github.com>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
…on msgs counterpart

Signed-off-by: Kenzo Lobos-Tsunekawa <kenzo.lobos@tier4.jp>
@knzo25 knzo25 requested review from mojomex and technolojin March 25, 2025 07:17
@xmfcx xmfcx changed the title feat(autoware_sensing_msgs): implemented the proposed universal radar messages feat(autoware_perception_msgs): implement the proposed universal radar messages Mar 25, 2025
@@ -6,7 +6,8 @@ ament_auto_find_build_dependencies()

set(msg_files
"msg/GnssInsOrientation.msg"
"msg/GnssInsOrientationStamped.msg")
"msg/GnssInsOrientationStamped.msg"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put the parenthesis back up? To keep consistent.

Copy link

@technolojin technolojin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@mojomex mojomex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

In the future I'd like to have a small wrapper shipped with the messages package (akin to PointCloud2Iterator) to enforce correct usage since these message types are (necessarily) quite complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants